# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=asteroid
pkgname=asteroid-launcher
pkgver=2.0.0
pkgrel=0
pkgdesc="AsteroidOS launcher and Wayland compositor based on Qt5, QML and QtWayland via Lipstick"
url="https://github.com/AsteroidOS/asteroid-launcher"
# armhf blocked by nemo-qml-plugin-calendar
arch="all !armhf"
license="BSD-3-Clause AND MIT"
depends="
	asteroid-icons-ion
	asteroid-languages
	asteroid-wallpapers
	lipstick-asteroidos
	mce
	nemo-qml-plugin-calendar
	nemo-qml-plugin-configuration
	nemo-qml-plugin-systemsettings
	nemo-qml-plugin-time
	qt5-qtgraphicaleffects
	"
# Normally we shouldn't hard depend on fonts, but in this case these fonts are
# hardcoded for some supported watchfaces
depends="$depends
	font-noto-emoji
	font-opensans
	font-raleway-otf
	font-roboto
	"
makedepends="
	extra-cmake-modules
	lipstick-asteroidos-dev
	qml-asteroid-dev
	qt5-qtbase-dev
	samurai
	"
subpackages="$pkgname-dbg"
source="$pkgname-$pkgver.tar.gz::https://github.com/AsteroidOS/asteroid-launcher/archive/refs/tags/$pkgver.tar.gz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -dm755 "$pkgdir"/usr/share/translations
	lrelease-qt5 -idbased i18n/asteroid-launcher.*.ts
	cp i18n/asteroid-launcher.*.qm "$pkgdir"/usr/share/translations/
}

sha512sums="
67b3c9ad5842e64036b4ac7f459258c7264a356bef6b13a72078523e808ddae815d47724ed2ad2c10bb4d3c06a756628dcb83d7f7d6021ba86caede0ce5340c8  asteroid-launcher-2.0.0.tar.gz
"
